package xyz.riceball.common.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import xyz.riceball.framework.core.annotation.RbLog;
import xyz.riceball.framework.core.annotation.RbSysRequest;
import xyz.riceball.framework.core.bean.ApiController;
import xyz.riceball.framework.core.bean.ApiR;
import xyz.riceball.common.entity.po.LanguagePO;
import xyz.riceball.common.service.LanguageService;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 语种查询
 * </p>
 *
 * @author xiaovcloud
 * @since 2022/5/28 17:10
 */
@Api(tags = "国际化管理")
@RbSysRequest
@RestController
@RequestMapping("/rb/api/sys/language")
public class LanguageController extends ApiController {

    @Resource
    private LanguageService languageService;

    /**
     * 查询所有语种
     *
     * @return
     */
    @ApiOperation(value = "查询所有语言")
    @GetMapping
    @RbLog(description = "查询所有语言")
    public ApiR<List<LanguagePO>> selectAll() {
        return success(languageService.list());
    }

}
